package com.zichen.pr.common.core.page;

import cn.hutool.core.util.StrUtil;
import com.zichen.pr.util.StringUtils;
import lombok.Data;

/**
 * @program: pr
 * @description: 分页数据
 * @author: rzhang
 * @create: 2021-04-01 15:54
 */
@Data
public class PageDomain {
    /** 当前记录起始索引 */
    private Integer pageNum;

    /** 每页显示记录数 */
    private Integer pageSize;

    /** 排序的方向desc或者asc */
    private String isAsc = "asc";

    /** 排序列 */
    private String orderByColumn;

    public String getOrderBy()
    {
        if (StringUtils.isEmpty(orderByColumn))
        {
            return "";
        }
        return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
    }
}
